Loading a JAR file

A JAR file is an archive which contains a collection of resources, e.g. beans, class files, images, text. Normally a JAR file will have a filename with a .jar extension, although .zip is also used. Visaj will read either file.

By selecting "Load Jar file" from the Palette menu a file dialog will pop-up prompting you for a filename.
Once a file is selected, Visaj examines the file. If Visaj discovers a non-class file, then it is loaded into Visaj's memory. If it finds a manifest file then that is read into memory, and used while examining the rest of the JAR file.
A Manifest file is a special file which describes each of the files in the archive. When a class file is found in a JAR file, the Manifest file is checked to see if this class file is a JavaBean. In a Manifest file, a special "Java-Bean: true" line is used to indicate that the class is a JavaBean. If the class is not a JavaBean then, like non-class files, it is loaded into memory.
If however, the class is a JavaBean then an image is placed onto the Palette.

Any class file which has been placed on the palette can be used in your designs. A good example of this is the Juggler bean, which is included in the Beans Development Kit. Note: If you have created your own .jar file and your Class is not appearing on the Palette, then this is usually because either you have not created a Manifest file, or because you haven't added the "Java-Bean: true" line to your classes entry.